#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
	FILE *fd;
	int ch;
	char buf[128];
	printf("Stream: \n");
	fd = fopen(argv[1], "w+");
	if(fd == NULL)
	{
		perror(argv[0]);
		exit(1);
	}
	if(fd == NULL)
	{
		perror(argv[0]);
		return 1;
	}
	while(ch != EOF)
	{

		ch = getchar();
		fputc(ch, fd);	
	}
	fclose(fd);
	return 0;
}
